Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix isTokenUtxo to non SLP transactions #85

Merged
merged 2 commits into from
Jan 14, 2020

Conversation

thr0wn
Copy link
Contributor

@thr0wn thr0wn commented Jan 10, 2020

Hi :)

I found that SLP.Utils.isTokenUtxo does not handle validations like SLP.Utils.tokenUtxoDetails. More specifically, the following code of SLP.Utils.isTokenUtxo does not handle null cases of x:

validations = validations.map((x: any) => x.valid)

I think that it should be done like in https://github.com/Bitcoin-com/slp-sdk/blob/master/src/Util.ts#L462,
correct?

By the way, thanks for your effort here at slp-sdk, it is a really helpful library!

@christroutner
Copy link
Contributor

christroutner commented Jan 12, 2020

Thanks for the PR! It looks like a great addition to the repository, and mirrors a similar PR I just created for tokenUtxoDetails() a couple days ago.

And thanks for alerting us to the issue. We just caught it ourselves.

The only thing we need to do before accepting the PR is for the Developer Services team to review the implications to SLP-aware wallets interacting with isTokenUtxo() if we merge this PR.

We recently got clarity: SLPDB returns null for a BCH-only TXID AND it returns null for SLP transactions that it hasn't processed yet.

That's the main thing we need to take into consideration.

@christroutner
Copy link
Contributor

Going to merge this PR. Thank you @thr0wn!

After this PR is merged, I'll also refactor this function to match the refactoring done to tokenUtxoDetails() in PR #86. The new behavior of this function will return confident false or true. It will only return null if SLPDB has not processed the UTXO yet and has not yet made a determination of its validity.

@christroutner christroutner merged commit 5b72a65 into Bitcoin-com:master Jan 14, 2020
@christroutner
Copy link
Contributor

Created Issue #87 to capture future work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants